// Decompiled by:       Fernflower v0.6
// Date:                28.11.2010 03:55:55
// Copyright:           2008-2009, Stiver
// Home page:           http://www.reversed-java.com


public class MCThread implements Runnable {

   private boolean D = false;
   private gg F;
   private boolean I = false;
   private boolean J = false;
   private boolean KKLI = false;
   private boolean L = false;
   private boolean O = false;
   private Status aA;
   private Direction aG;


   public MCThread(gg var1) {
      this.aA = Status.C;
      this.aG = Direction.I;
      this.F = var1;
   }

   public final void run() {
      for(; this.D; D(10)) {
         if(this.F()) {
            long var1 = this.F.e.e;
            if(this.L) {
               this.F.g.aG = true;
               this.F.g.aS = 0.0F;
            }

            if(this.O) {
               this.F.g.az = 0.0D;
            }

            if(this.I) {
               this.F.g.J = 20;
               this.F.g.L = 0;
               this.F.g.O = 0;
            }

            if(this.J) {
               this.F.g.bi = 300;
            }

            if(this.KKLI) {
               this.F.g.be = 0;
            }

            if(!this.aG.equals(Direction.I)) {
               if(this.aG.equals(Direction.Z)) {
                  this.F.g.ay = -0.5D;
               }

               if(this.aG.equals(Direction.C)) {
                  this.F.g.aA = -0.5D;
               }

               if(this.aG.equals(Direction.B)) {
                  this.F.g.ay = 0.5D;
               }

               if(this.aG.equals(Direction.D)) {
                  this.F.g.aA = 0.5D;
               }
            }

            if(this.aA.equals(Status.I)) {
               if(var1 % 24000L >= 12000L) {
                  this.F.e.e = (var1 / 24000L + 1L) * 24000L;
               }
            } else if(this.aA.equals(Status.Z) && var1 % 24000L < 12000L) {
               this.F.e.e = (var1 / 24000L + 1L) * 24000L + 16000L;
            }
         }
      }

   }

   public final void I() {
      this.D = true;
      (new Thread(this)).start();
   }

   private static void D(int var0) {
      try {
         Thread.sleep((long)var0);
      } catch (InterruptedException var2) {
         ;
      }

   }

   public final void I(boolean var1) {
      if(var1) {
         this.I = true;
      } else {
         this.I = false;
      }

   }

   public final void Z(boolean var1) {
      if(var1) {
         this.J = true;
      } else {
         this.J = false;
      }

   }

   public final void C(boolean var1) {
      if(var1) {
         this.KKLI = true;
      } else {
         this.KKLI = false;
      }

   }

   public final void B(boolean var1) {
      if(var1) {
         this.L = true;
      } else {
         this.L = false;
      }

   }

   public final void D(boolean var1) {
      if(var1) {
         this.O = true;
      } else {
         this.O = false;
      }

   }

   public final void I(Direction var1) {
      this.aG = var1;
   }

   public final void I(Status var1) {
      this.aA = var1;
   }

   private boolean F() {
      return this.F.e != null && this.F.g != null && this.F.g.e != null;
   }
}
